public class Solution70 {
    public int climbStairs(int n) {
        if (n<=2){
            return n;
        }
        int a=1,b=2,c;
        for (int i=3;i<=n;i++){
            c=a+b;
            a=b;
            b=c;
        }
        return b;
    }

    public static void main(String[] args) {
        System.out.println(new Solution70().climbStairs(3));
    }
}
